//html 生成

var flash = {};

flash.getMajorVersion = function() {
	var flashMajorVersion = 0;
	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
		// Flash detection for browsers using Netscape's plugin architecture
		var i = navigator.plugins["Shockwave Flash"];
		if (i && i.description) {
			flashMajorVersion = parseInt(i.description.match(/[0-9]+/)[0], 10);
		}
	} else {
		// Flash detection for IE
		// This is done by trying to create an ActiveX object with the name
		// "ShockwaveFlash.ShockwaveFlash.{majorVersion}".
		for (var version = 10; version > 0; version--) {
			try {
				var dummy = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + version);
				return version;
			} catch (e) {
			}
		}
	}
	return flashMajorVersion;
};

flash.swfContainerId_ = 0;

flash.embedFlash = function(swfUrl, swfContainer, swfVersion, opt_params) {
	switch (typeof swfContainer) {
		case 'string':
			swfContainer = document.getElementById(swfContainer);
		case 'object':
			if (swfContainer && (typeof swfContainer.innerHTML === 'string')) {
				break;
			}
		default:
			return false;
	}
	
	switch (typeof opt_params) {
		case 'undefined':
			opt_params = {};
		case 'object':
			break;
		default:
			return false;
	}
	
	if (swfUrl.indexOf('//') == 0) {
		swfUrl = document.location.protocol + swfUrl;
	}
	
	var ver = flash.getMajorVersion();
	if (ver) {
		var swfVer = parseInt(swfVersion, 10);
		if (isNaN(swfVer)) {
			swfVer = 0;
		}
		if (ver >= swfVer) {
			// Set default size
			if (opt_params.width === void 0) {
				opt_params.width = '100%';
			}
			if (opt_params.height === void 0) {
				opt_params.height = '100%';
			}
			// Set the default "base" attribute
			if (typeof opt_params.base !== 'string') {
				var a = document.createElement('a');
				a.href = swfUrl;
				// Get the part up to the last slash
				opt_params.base = a.href.match(/^(.*\/)[^\/]*$/)[1];
			}
			// Set wmode to "opaque" if it's not defined. The default value
			// "window" is undesirable because browsers will render Flash
			// on top of other html elements.
			if (typeof opt_params.wmode !== 'string') {
				opt_params.wmode = 'opaque';
			}
			while (!opt_params.id) {
				var newId = 'swfContainer' + flash.swfContainerId_++;
				if (!document.getElementById(newId)) {
					opt_params.id = newId;
				}
			}
			// Prepare flash object
			var flashObj;
			if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
				// Use <embed> tag for Netscape and Mozilla browsers
				opt_params.type = 'application/x-shockwave-flash';
				opt_params.src = swfUrl;
				
				flashObj = document.createElement('embed');
				for (var prop in opt_params) {
					if (!/^swf_/.test(prop) && !/___$/.test(prop)) {
						flashObj.setAttribute(prop, opt_params[prop]);
					}
				}
			} else {
				// Use <object> tag for IE
				opt_params.movie = swfUrl;
				var attr = {
					width: opt_params.width,
					height: opt_params.height,
					classid: "clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"
				};
				if (opt_params.id) {
					attr.id = opt_params.id;
				}
	
				flashObj = document.createElement('object');
				flashObj.setAttribute('data', swfUrl);
				for (var attrProp in attr) {
					if (!/___$/.test(attrProp)) {
						flashObj.setAttribute(attrProp, attr[attrProp]);
					}
				}
				for (var paramsProp in opt_params) {
					var param = document.createElement('param');
					if (!/^swf_/.test(paramsProp) && !attr[paramsProp] && !/___$/.test(paramsProp)) {
						param.setAttribute('name', paramsProp);
						param.setAttribute('value', opt_params[paramsProp]);
						flashObj.appendChild(param);
					}
				}
			}
			// Inject flash object
			swfContainer.innerHTML = '';
			swfContainer.appendChild(flashObj);
			return true;
		}
	}
	return false;
};

(function(){
	flash.embedFlash(
		'HtmlGenerator.swf',
		'externalFlash',
		'10.0.0',
		{ 'width' : 100, 'height': 20, 'allowScriptAccess': 'always', 'base': '.', 'wmode': ''}
	);
})();

function close(){
	window.name = 'close';
	history.back();
	//window.location.href = decodeURIComponent( document.URL.split( '#')[ 1]);
}